package com.itheima.tlias84.controller;

import com.itheima.tlias84.dto.ReportStuDegreeDTO;
import com.itheima.tlias84.service.ReportServiceStu;
import com.itheima.tlias84.utils.ResultUtil;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/report/")
public class ReporStuController {

    @Resource
    ReportServiceStu reportServiceStu;

    @GetMapping("studentDegreeData")
    public ResultUtil countStuByDegree() {
        List<ReportStuDegreeDTO> dtos = reportServiceStu.countStuByDegree();
        return ResultUtil.success(dtos);
    }
    @GetMapping("studentCountData")
    public ResultUtil countStuByClazzId() {
        return reportServiceStu.countStuByClazzId();
    }
}
